#define _CRT_SECURE_NO_WARNINGS

#include "sort.h"

//void Print(int* arr, int n)
//{
//	for (int i = 0; i < n; i++)
//	{
//		printf("%d ", arr[i]);
//	}
//	printf("\n");
//}
//
//int main()
//{
//	int arr[] = { 33,3 ,32,1,1,44,4,4, 3,44,54,34,62,3,65234 };
//	int n = sizeof(arr) / sizeof(arr[0]);
//	Print(arr, n);
//
//	//BubbleSort(arr, n);
//	QuickSort(arr, 0, n - 1);
//	Print(arr, n);
//	return 0;
//}

void TestOP()
{
    srand((unsigned int)time(NULL));
    const int N = 100000;
    int* a1 = (int*)malloc(sizeof(int) * N);
    int* a2 = (int*)malloc(sizeof(int) * N);

    for (int i = 0; i < N; ++i)
    {
        a1[i] = rand();
        a2[i] = a1[i];
    }

    int begin1 = clock();
    BubbleSort(a1, N);
    int end1 = clock();

    int begin2 = clock();
    QuickSort(a2, 0, N - 1);
    int end2 = clock();

    printf("BubbleSort:%d\n", end1 - begin1);
    printf("QuickSort:%d\n", end2 - begin2);

    free(a1);
    free(a2);
}

int main()
{
    TestOP();
    return 0;
}